//package net.jjjshop.controller;
//
//import cn.lili.common.enums.ResultCode;
//import cn.lili.common.enums.ResultUtil;
//import cn.lili.common.vo.ApiResult;
//import cn.lili.modules.im.entity.dos.ImTalk;
//import cn.lili.modules.im.entity.vo.ImTalkVO;
//import cn.lili.modules.im.service.ImTalkService;
//import com.github.binarywang.wxpay.constant.WxPayConstants;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.RequiredArgsConstructor;
//import net.jjjshop.common.entity.im.ImTalk;
//import net.jjjshop.framework.common.api.ApiResult;
//import net.jjjshop.service.ImTalkService;
//import net.jjjshop.vo.ImTalkVO;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
//
///**
// * @author Chopper
// */
//@RestController
//@Api(tags = "聊天接口")
//@RequestMapping("/im/talk")
//@Transactional(rollbackFor = Exception.class)
//public class ImTalkController {
//
//    @Autowired
//    private ImTalkService imTalkService;
//
//    @GetMapping(value = "/{id}")
//    @ApiOperation(value = "查看聊天详情")
//    public ApiResult<ImTalk> get(@PathVariable String id) {
//
//        ImTalk imTalk = imTalkService.getById(id);
//        return  ApiResult.ok(imTalk);
//    }
//
//    @GetMapping(value = "/user/{uid}")
//    @ApiOperation(value = "查看与某人聊天详情")
//    public ApiResult<ImTalk> getUser(@PathVariable String uid) {
//        //通过长度判断,保证每次都是同一个聊天
//        return  ApiResult.ok(imTalkService.getTalkByUser(uid));
//    }
//
//    @GetMapping(value = "/by/user/{userId}")
//    @ApiOperation(value = "查看与某人聊天详情")
//    public ApiResult<ImTalkVO> getByUser(@PathVariable String userId) {
//        return  ApiResult.ok(imTalkService.getTalkByUserId(userId));
//    }
//
//    @GetMapping(value = "/top")
//    @ApiOperation(value = "查看与某人聊天详情")
//    public ApiResult<> top(String id, Boolean top) {
//        imTalkService.top(id, top);
//        return ApiResult.ok();
//    }
//
//    @GetMapping("/list")
//    @ApiOperation(value = "分页获取用户聊天")
//    public ApiResult<List<ImTalkVO>> getUserTalkList() {
//        return ApiResult.ok(imTalkService.getUserTalkList());
//    }
//
//    @GetMapping("/store/list")
//    @ApiOperation(value = "分页获取商家聊天")
//    public ApiResult<List<ImTalkVO>> getStoreTalkList() {
//        return ApiResult.ok(imTalkService.getStoreTalkList());
//    }
//
//    @DeleteMapping(value = "/{id}")
//    @ApiOperation(value = "删除聊天")
//    public ApiResult<String> disable(@PathVariable String id) {
//        imTalkService.disable(id);
//        return ApiResult.ok(null,"删除成功");
//    }
//}
